home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
supratxt.zip
/
BIN2DEC.TXT
< prev
next >
Wrap
Text File
|
1993-02-09
|
2KB
|
48 lines
This text was posted to Supra by a user to help others understand how to set
bit-mapped registers on modems and similiar devices.
================================================================================
Binary Addition
---------------
Binary Addition is a method used to convert a 8-bit register to a control-bank
of 8-switches. An 8-bit register can code itself into any decimal number
between 0 and 255. The following list illustrates how this works:
Register=8-Bits.
Bit# 7 6 5 4 3 2 1 0
--- -- -- -- -- -- -- --
Decimal value 128 64 32 16 8 4 2 1
Each bit may equal zero, which is equivelent to that bit being "turned-OFF".
If the value of the bit is asserted, then that specific bit is "turned-ON".
So how does one turn "ON" a combination of bits, while leaving others "OFF"?
This is accomplished by selecting the appropriate bits which must be "ON", then
adding their specific values together as an agrigate, then sending this code to
the register in the format required (hexidecimal or decimal; in most Hayes
controlled modems, decimal is acceptable, SupraModems and SupraFAXModems are set
in decimal). For example; let's assume we wish to turn "ON" bits 0,2,4,5 and
leave "OFF" everything else. What is the resulting value?:
1+4+16+32=53 decimal
While the bits selected, get turned "ON", the effect of ignoring the other
registers is to mask them "OFF", as a default. Bits not selected, do not stay
as they were, they will be reset (turned-OFF) by this action.
As you can see, this operation is simple, yet fundemental to the operation of
modems and computers. Yet this procedure is fairly "arcane" to many computer
users. This text is an attempt to clarify this matter. We hope it helps you!
================================================================================